  <?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/
//前台主页
Route::get('/', function () {
    return view('home.index');
});

//更多
Route::get('/home/more/CDN','Home\MoreController@CDN');
Route::get('/home/more/HR','Home\MoreController@HR');
Route::get('/home/more/contact','Home\MoreController@contact');
Route::get('/home/more/xunlei','Home\MoreController@xunlei');
//产品中心
Route::get('/home/product/index','Home\CateController@show');

//新闻
Route::get('/home/news',function(){
	return view('home.news');
});

//后台中间件
Route::group(['middleware' => 'login'],function(){
	//用户管理
	//index主页
	Route::get('admin/index','Admin\IndexController@index');

	//add添加页
	Route::get('admin/user/add','Admin\UserController@add');

	//insert执行添加
	Route::post('/admin/user/insert','Admin\UserController@insert');

	//用户列表
	Route::get('/admin/user/index','Admin\UserController@index');
	Route::post('/admin/user/ajaxchangename','Admin\UserController@ajaxChangeName');
	Route::get('/admin/user/edit/{id}','Admin\UserController@edit');
	Route::get('/admin/user/delete/{id}','Admin\UserController@delete');
	Route::post('/admin/user/update/{id}','Admin\UserController@update');

	//后台产品
	Route::get('/admin/cate/add','Admin\CateController@add');
	Route::post('/admin/cate/insert','Admin\CateController@insert');
	Route::get('/admin/cate/index','Admin\CateController@index');
	Route::get('/admin/cate/edit/{id}','Admin\CateController@edit');	//编辑
	Route::get('/admin/cate/delete','Admin\CateController@delete');
	Route::post('/admin/cate/update/{id}','Admin\CateController@update');
	Route::post('/admin/cate/delete/{id}','Admin\CateController@delete');

	//后台游戏
	Route::get('/admin/games/add','Admin\GamesController@add');
	Route::post('/admin/games/insert','Admin\GamesController@insert');
	Route::get('/admin/games/index','Admin\GamesController@index');
	
	Route::get('/admin/games/delete/{id}','Admin\GamesController@delete');
	
	//游戏专区列类别管理
	Route::get('/admin/games/edit/{id}','Admin\SpecialController@edit');
	Route::post('/admin/games/update/{id}','Admin\SpecialController@update');
	
	//vip订单管理
	Route::get('/admin/order/index','Admin\OrderController@index');
	Route::get('/admin/order/delete/{id}','Admin\OrderController@delete');
	Route::get('/admin/order/recycle','Admin\OrderController@recycle');
	Route::get('/admin/order/suredel/{id}','Admin\OrderController@sureDel');
	Route::get('/admin/order/unsuredel/{id}','Admin\OrderController@unsureDel');

	//后台管理员
	Route::get('/admin/admin/add','Admin\AdminController@add');
	Route::post('/admin/admin/insert','Admin\AdminController@insert');
	Route::get('/admin/admin/index','Admin\AdminController@index');
	Route::get('/admin/admin/edit/{id}','Admin\AdminController@edit');
	Route::post('/admin/admin/update/{id}','Admin\AdminController@update');
	Route::get('/admin/admin/delete/{id}','Admin\AdminController@delete');

	//后台VIP
	Route::get('/admin/vip/add','Admin\VipController@add');
	Route::post('/admin/vip/insert','Admin\VipController@insert');
	Route::get('/admin/vip/index','Admin\VipController@index');
	Route::get('/admin/vip/edit/{id}','Admin\VipController@edit');
	Route::post('/admin/vip/update/{id}','Admin\VipController@update');
	Route::get('/admin/vip/delete/{id}','Admin\VipController@delete');

	//后台特权管理
	Route::get('/admin/tqvip/add','Admin\TqvipController@add');
	Route::post('/admin/tqvip/insert','Admin\TqvipController@insert');
	Route::get('/admin/tqvip/index','Admin\TqvipController@index');
	Route::get('/admin/tqvip/edit/{id}','Admin\TqvipController@edit');
	Route::post('/admin/tqvip/update/{id}','Admin\TqvipController@update');
	Route::get('/admin/tqvip/delete/{id}','Admin\TqvipController@delete');

});

//文件下载
Route::get('/home/download/{id}','Home\DownloadController@download');

//后台注册
Route::match(['get','post'],'/admin/register','Admin\RegisterController@register');

//后台登录
Route::match(['get','post'],'/admin/login','Admin\LoginController@login');

//退出登录
Route::get('/admin/logout','Admin\LoginController@logout');

//验证码
Route::get('kit/captcha/{tmp}', 'KitController@captcha');

//前台管理
//vip中心
Route::get('/home/vip/index','Home\IndexController@index');
Route::get('/home/vip/freedom','Home\ServiceController@freedom');
Route::get('/home/vip/game','Home\ServiceController@game');
Route::get('/home/vip/level','Home\ServiceController@level');
Route::get('/home/vip/supervip','Home\ServiceController@superVip');
Route::get('/home/vip/vipnf','Home\ServiceController@vipNf');

//开通会员
Route::get('/home/vip/buy','Home\BuyController@buy');
Route::post('/home/vip/select','Home\BuyController@select');
Route::post('/home/vip/insert','Home\BuyController@insert');

//会员付款
Route::get('/home/vip/pay/{id}','Home\PayController@pay');
Route::post('/home/vip/surepay','Home\PayController@surePay');

//前台登录
Route::match(['get','post'],'/home/register','Home\RegisterController@register');

//退出登录
Route::get('/home/logout','Home\RegisterController@logout');

//注册
Route::match(['get','post'],'/home/login','Home\LoginController@register');

//忘记密码
Route::get('/home/forget','Home\LoginController@forget');
Route::post('/home/forget','Home\LoginController@forget');

//重置密码
Route::post('/home/setpass','Home\LoginController@setpass');
Route::get('/home/inputpass/{remember_token}','Home\LoginController@inputpass');

//激活用户
Route::get('/home/active/{remember_token}','Home\LoginController@active');

//安全中心
Route::get('/home/aq/index','Home\AqController@index');
Route::get('/home/aq/phone','Home\AqController@phone');
Route::get('/home/aq/question','Home\AqController@question');
Route::post('/home/aq/verify','Home\AqController@verify');
Route::get('/home/aq/answer','Home\AqController@answer');
Route::post('/home/aq/sure','Home\AqController@sure');
Route::get('/home/aq/login','Home\AqController@login');
Route::get('/home/aq/clear','Home\AqController@clear');
Route::post('/home/aq/judge','Home\AqController@judge');

